<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>

<div id="test1">
<input type="checkbox" name="test[x]" value="test1">test1
<input type="checkbox" name="test[y]" value="test2">test2
</div>

<div id="test2">
    <input type="checkbox" name="test[z]" value="test3">test3
    <input type="checkbox" name="test[w]" value="test4">test4
</div>


<script>
    $(function () {
        $("#test2 input:checkbox:first").attr("checked",'checked');
    })
</script>
</body>
</html>